package com.icinfo.cloud.provider.common.service;

import com.icinfo.cloud.common.security.util.UserUtil;
import com.icinfo.cloud.provider.common.exception.BusinessException;
import com.icinfo.cloud.xzcf.provider.member.userinfo.dto.UserDTO;
import com.icinfo.framework.core.service.BaseService;

/**
 * 处罚基础service
 *
 * @author Junfeng.Chen
 * @date 2024/1/10 15:40
 **/
public interface PunishBaseService extends BaseService {
    default UserDTO getUser() {
        UserDTO userDTO = UserUtil.getUserInfo();
        if (userDTO == null) {
            throw new BusinessException("未登录或登录信息已失效");
        }
        return userDTO;
    }
}
